package com.yanqu.road.entity.unioncampwar.cross;


import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.math.BigInteger;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 商帮分组的商会
 */
@FieldTypeAnnotation(tableName = "t_c_union_camp_war_group_union", autoSave = true)
public class CrossUnionCampWarGroupUnionData extends DataObject {

    @FieldTypeAnnotation(desc = "对应的中心服配置分组id", update = true, select = true)
    private int centerGroupId;
    @FieldTypeAnnotation(desc = "分组Id", update = true, select = true)
    private int groupId;
    @FieldTypeAnnotation(desc = "商会id", update = true)
    private String unionId;
    @FieldTypeAnnotation(desc = "阵营id")
    private int campId;
    @FieldTypeAnnotation(desc = "周", update = true)
    private int weekId;
    @FieldTypeAnnotation(desc = "赚钱")
    private BigInteger totalAbility = BigInteger.ZERO;
    @FieldTypeAnnotation(desc = "服务器id")
    private long serverId;
    @FieldTypeAnnotation(desc = "报名期结束锁定的成员id-职位")
    private Map<Long, Integer> mermberPositionMap = new ConcurrentHashMap<>();

    public int getGroupId() {
        return groupId;
    }
    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setOp(DataStatus.Update);
        }
    }

    public int getCenterGroupId() {
        return centerGroupId;
    }

    public void setCenterGroupId(int centerGroupId) {
        this.centerGroupId = centerGroupId;
    }

    public String getUnionId() {
        return unionId;
    }

    public void setUnionId(String unionId) {
        this.unionId = unionId;
    }

    public long getServerId() {
        return serverId;
    }

    public void setServerId(long serverId) {
        this.serverId = serverId;
    }

    public Map<Long, Integer> getMermberPositionMap() {
        return mermberPositionMap;
    }

    public void setMermberPositionMap(Map<Long, Integer> mermberPositionMap) {
        this.mermberPositionMap = mermberPositionMap;
        setUpdateOption();
    }

    public int getCampId() {
        return campId;
    }

    public void setCampId(int campId) {
        if (this.campId != campId){
            this.campId = campId;
            setUpdateOption();
        }
    }

    public int getWeekId() {
        return weekId;
    }

    public void setWeekId(int weekId) {
        if (this.weekId != weekId){
            this.weekId = weekId;
            setUpdateOption();
        }
    }

    public void resetCamp(){
        this.campId = 0;
        this.weekId = 0;
        setUpdateOption();
    }

    public BigInteger getTotalAbility() {
        return totalAbility;
    }

    public void setTotalAbility(BigInteger totalAbility) {
        this.totalAbility = totalAbility;
        setUpdateOption();
    }
}
